/**
 * 
 */
package com.oolong.account.web;

import java.util.List;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.oolong.account.model.UserModel;
import com.oolong.account.service.StaticManage;
import com.oolong.account.vo.DateStaticVo;

/**
 * @author oolong
 * 
 */
// 标记它是个SPRING的BEAN，是MVC里的C
@Controller
// 表示这个类就是staticdayOutItem.do
@RequestMapping("/staticdayOutItem.do")
public class StaticDayController {
	Logger logger = Logger.getLogger(StaticDayController.class);
	// 表示需要SPRING自动注入
	@Autowired
	private StaticManage staticManage;

	@RequestMapping(method = RequestMethod.GET)
	public String processOutItem(ModelMap model, HttpServletResponse response,
			HttpSession session) {
		UserModel userModel = (UserModel) session.getAttribute("user");
		int user_id = userModel.getId();
		List<DateStaticVo> dateStaticVos = staticManage
				.DayStaticService(user_id);
		model.addAttribute("dateStaticVos", dateStaticVos);
		String time = "本月";
		model.addAttribute("time", time);
		response.setContentType("text/html;charset=UTF-8");
		return "staticoutday";
	}
}
